அறிவியற்பா: பொருண்மையீர்ப்பு அலைகள்!

ParamAnu

பொருண்மையீர்ப்பு அலைகளில் முக்கியப் பங்காற்றியுள்ள இந்திய
Tata Institute for Fundamental Research, Chennai Mathematical Insitute, Indian Institute of Sci. Ed. and Research – Trivandrum and Kolkata, Inter-University Campus for Astronomy and Astrophysics, IIT Gandhinagar, Raja Ramanna Center for Advanced Tech.-Indore -ஆய்வாளர்களுக்கு வாழ்த்துகள்!

நேற்று வெளிவந்த பொருண்மையீர்ப்பு அலைகளைப் பற்றிய கண்டுபிடிப்பை வைத்து ஒரு வெண்பா!

சொற்பிழை பொருட்பிழை யிருப்பினும் பொறுத்தருளிக் கோடி காட்டுக!  தளை தட்டினாலும் தலை தட்டாமல் கூறுக!

ஈரேழ் உலகைச் சூலகத்தில்  இட்டவள்
சீராய் விரித்த வியன்செயல் ஓதுவோம்
கூராய் குறுக்கி, பலகணியில் நோக்கிலும் (அதன்)
தீரா அழகே/அறிவே சிறப்பு

[இரண்யகர்ப்பம் போன்ற பேரண்டம் வெடித்து வந்ததை, தெரிந்தவற்றைக் கொண்டுக் காணும் போதும், அதன் அழகு பீடுடையது.]

ஏந்திழையின்பொன்சூல் வெடித்தே விரிய
இழையெங்கும் சூழ்கொண் டுழன்றுப் பொடிக்க
மழையாய், களிகொண்டத் தூள்கூடி கூட்டுத்தூள்
விசைபெற்றே ஆன தணு!

[பெருவெடிப்பு சூல் கொண்டு வெடித்தப்பின்பு, ஆற்றல் இழைவடிவாக இருந்து, அதனின்று மென் துகள்கள், அதனின்று வன்  துகள்கள், அணுவும் உண்டானது ]

அணுக்கள் அணுக்கமாகி ஈங்குப் பொருளமைய
ஆழியது வெந்தது போல் கோளமெங்கும் விரிய
இணுங்கிய தூள்கூடி விண்மீனாய் ஆகியே
ஈன்றவே தீப்பிழம்(பு) உலகு.

[அணுக்கள் கூடி ஒளிப்பிழம்பாகப் பொருளாகவும், அவை கூடி விண்மீன் உண்டானது]

விண்மீன் உமிழ்ந்த ஒளிவெளி செல்ல
விழுகூன் கிழமீன் உளதில் இடுங்கிட

View original post 214 more words

Spark Color Picker


package components{
import flash.display.DisplayObject;
import flash.events.Event;
import mx.collections.IList;
import mx.controls.colorPickerClasses.WebSafePalette;
import mx.graphics.SolidColor;
import spark.components.ComboBox;
import spark.events.DropDownEvent;
/**
* Subclass DropDownList and make it work like a ColorPicker
*/
public class SparkColorPicker extends ComboBox
{
private var wsp:WebSafePalette;
public function SparkColorPicker()
{
super();
wsp = new WebSafePalette();
super.dataProvider = wsp.getList();
labelFunction = blank;
labelToItemFunction = colorFunction;
openOnInput = false;
addEventListener(Event.CHANGE, colorChangeHandler);
}
private function colorFunction(value:String):*
{
return uint(value);
}
private function colorChangeHandler(event:Event):void
{
if (current)
current.color = selectedItem;
}
private function blank(item:Object):String
{
return "";
}
[SkinPart(required="false")]
public var current:SolidColor;
// don't allow anyone to set our custom DP
override public function set dataProvider(value:IList):void
{
}
/**
* @private
*/
override protected function partAdded(partName:String, instance:Object):void
{
super.partAdded(partName, instance);
if (instance == current)
current.color = selectedItem;
}
override public function setFocus():void
{
stage.focus = this;
}
override protected function isOurFocus(target:DisplayObject):Boolean
{
return target == this;
}
override protected function dropDownController_closeHandler(event:DropDownEvent):void
{
event.preventDefault();
super.dropDownController_closeHandler(event);
}
}
}


<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009&quot; xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fb="http://ns.adobe.com/flashbuilder/2009&quot; xmlns:local="*" alpha.disabled=".5" minWidth="24"
currentStateChange="if (currentState == 'open') prepOpenState()" xmlns:components="com.cognizant.awcoe.tailor.components.*">
<!– host component –>
<fx:Metadata>
<![CDATA[
/**
* @copy spark.skins.spark.ApplicationSkin#hostComponent
*/
[HostComponent("spark.components.ComboBox")]
]]>
</fx:Metadata>
<fx:Script fb:purpose="styling">
<![CDATA[
import spark.components.ComboBox;
import spark.events.IndexChangeEvent;
/* Define the content fill items that should be colored by the "contentBackgroundColor" style. */
static private const contentFill:Array = ["bgFill"];
/**
* @private
*/
override public function get contentItems():Array {return contentFill};
/**
* @private
*/
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
{
if (getStyle("borderVisible") == false)
{
if (border)
border.visible = false;
if (background)
{
background.left = background.top = background.right = background.bottom = 0;
}
if (swatchpanel)
{
swatchpanel.left = swatchpanel.top = swatchpanel.right = swatchpanel.bottom = 0;
}
}
else
{
if (border)
border.visible = true;
if (background)
{
background.left = background.top = background.right = background.bottom = 1;
}
if (swatchpanel)
{
swatchpanel.left = swatchpanel.top = swatchpanel.right = swatchpanel.bottom = 1;
}
}
if (dropShadow)
dropShadow.visible = getStyle("dropShadowVisible");
openButton.setStyle("cornerRadius", getStyle("cornerRadius"));
if (borderStroke)
{
borderStroke.color = getStyle("borderColor");
borderStroke.alpha = getStyle("borderAlpha");
}
super.updateDisplayList(unscaledWidth, unscaledHeight);
}
private function prepOpenState():void
{
if (preview)
previewColor.color = hostComponent.selectedItem as uint;
}
public function handleEnter():void
{
hostComponent.selectedItem = previewColor.color;
//hostComponent.closeDropDown(true);
hostComponent.dispatchEvent(new IndexChangeEvent(IndexChangeEvent.CHANGE));
}
]]>
</fx:Script>
<s:states>
<s:State name="normal" />
<s:State name="open" />
<s:State name="disabled" />
</s:states>
<!—
The PopUpAnchor control that opens the drop-down list.
<p>In a custom skin class that uses transitions, set the
<code>itemDestructionPolicy</code> property to <code>none</code>.</p>
–>
<s:PopUpAnchor id="popUp" displayPopUp.normal="false" displayPopUp.open="true" includeIn="open"
left="0" right="0" top="0" bottom="0" itemDestructionPolicy="auto"
popUpPosition="below" popUpWidthMatchesAnchorWidth="false">
<!—
This includes borders, background colors, scrollers, and filters.
@copy spark.components.supportClasses.DropDownListBase#dropDown
–>
<components:FocusGroup id="dropDown" >
<!— @private –>
<s:RectangularDropShadow id="dropShadow" blurX="20" blurY="20" alpha="0.45" distance="7"
angle="90" color="#000000" left="0" top="0" right="0" bottom="0"/>
<!— @private –>
<s:Rect id="border" left="0" right="0" top="0" bottom="0">
<s:stroke>
<!— border stroke @private –>
<s:SolidColorStroke id="borderStroke" weight="1"/>
</s:stroke>
</s:Rect>
<!– fill –>
<!— Defines the appearance of drop-down list's background fill. –>
<s:Rect id="background" left="1" right="1" top="1" bottom="1" >
<s:fill>
<!—
The color of the drop down's background fill.
The default color is 0xFFFFFF.
–>
<s:SolidColor id="bgFill" color="0xFFFFFF" />
</s:fill>
</s:Rect>
<s:VGroup id="swatchpanel" left="0" top="0" right="0" bottom="0" >
<s:HGroup>
<s:Rect id="preview" width="50" height="20" >
<s:fill>
<s:SolidColor id="previewColor" />
</s:fill>
</s:Rect>
</s:HGroup>
<s:Group>
<s:Rect left="0" top="0" right="0" bottom="0" width="220" height="132" >
<s:fill>
<s:SolidColor color="0x0" />
</s:fill>
</s:Rect>
<s:DataGroup id="dataGroup" left="0" top="0" right="0" bottom="0" width="220" height="132" >
<s:layout>
<s:TileLayout verticalGap="0" horizontalGap="0" requestedColumnCount="20" requestedRowCount="12"/>
</s:layout>
<s:itemRenderer>
<fx:Component>
<s:ItemRenderer rollOver="outerDocument.previewColor.color = uint(data);outerDocument.handleEnter()">
<s:states>
<s:State name="normal" />
<s:State name="hovered" />
<s:State name="selected" />
</s:states>
<s:Rect id="swatch" width="10" height="10">
<s:fill>
<s:SolidColor color="{data}" />
</s:fill>
<s:stroke>
<s:SolidColorStroke color="0xFFFF00" alpha.hovered="1" alpha="0" />
</s:stroke>
</s:Rect>
</s:ItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:DataGroup>
</s:Group>
</s:VGroup>
</components:FocusGroup>
</s:PopUpAnchor>
<!— The default skin is DropDownListButtonSkin.
@copy spark.components.supportClasses.DropDownListBase#openButton
@see spark.skins.spark.DropDownListButtonSkin –>
<s:Button id="openButton" left="0" right="0" top="0" bottom="0" focusEnabled="false"
skinClass="com.cognizant.awcoe.tailor.components.ColorPickerListButtonSkin" />
<s:Rect id="currentColor" left="2" right="2" top="2" bottom="2" width="20" height="20" radiusX="2">
<s:fill>
<s:SolidColor id="current" />
</s:fill>
</s:Rect>
</s:SparkSkin>


<?xml version="1.0" encoding="utf-8"?>
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009&quot; xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fb="http://ns.adobe.com/flashbuilder/2009&quot; minWidth="24" minHeight="24">
<fx:Metadata>
<![CDATA[
/**
* @copy spark.skins.spark.ApplicationSkin#hostComponent
*/
[HostComponent("spark.components.Button")]
]]>
</fx:Metadata>
<fx:Script fb:purpose="styling">
/* Define the skin elements that should not be colorized.
For dropDownList buttons, the graphics are colorized but the arrow is not. */
static private const exclusions:Array = []//"icon"];
/**
* @private
*/
override public function get colorizeExclusions():Array {
return exclusions;
}
/* Define the symbol fill items that should be colored by the "symbolColor" style. */
// static private const symbols:Array = ["arrowFill1", "arrowFill2"];
/**
* @private
*/
/**
* @private
*/
override protected function initializationComplete():void
{
useChromeColor = true;
super.initializationComplete();
}
/**
* @private
*/
override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number) : void
{
var cr:Number = getStyle("cornerRadius");
if (cornerRadius != cr)
{
cornerRadius = cr;
shadow.radiusX = cornerRadius;
fill.radiusX = cornerRadius;
lowlight.radiusX = cornerRadius;
highlight.radiusX = cornerRadius;
border.radiusX = cornerRadius;
}
if (highlightStroke) highlightStroke.radiusX = cornerRadius;
if (hldownstroke1) hldownstroke1.radiusX = cornerRadius;
if (hldownstroke2) hldownstroke2.radiusX = cornerRadius;
super.updateDisplayList(unscaledWidth, unscaledHeight);
}
private var cornerRadius:Number = 2;
</fx:Script>
<!– states –>
<s:states>
<s:State name="up" />
<s:State name="over" />
<s:State name="down" />
<s:State name="disabled" />
</s:states>
<!– layer 1: shadow –>
<!— @private –>
<s:Rect id="shadow" left="-1" right="-1" top="-1" bottom="-1" radiusX="2">
<s:fill>
<s:LinearGradient rotation="90">
<s:GradientEntry color="0x000000"
color.down="0xFFFFFF"
alpha="0.01"
alpha.down="0" />
<s:GradientEntry color="0x000000"
color.down="0xFFFFFF"
alpha="0.07"
alpha.down="0.5" />
</s:LinearGradient>
</s:fill>
</s:Rect>
<!– layer 2: fill –>
<!— @private –>
<s:Rect id="fill" left="1" right="1" top="1" bottom="1" radiusX="2">
<s:fill>
<s:LinearGradient rotation="90">
<s:GradientEntry color="0xFFFFFF"
color.over="0xBBBDBD"
color.down="0xAAAAAA"
alpha="0.85" />
<s:GradientEntry color="0xD8D8D8"
color.over="0x9FA0A1"
color.down="0x929496"
alpha="0.85" />
</s:LinearGradient>
</s:fill>
</s:Rect>
<!– layer 3: fill lowlight –>
<!— @private –>
<s:Rect id="lowlight" left="1" right="1" top="1" bottom="1" radiusX="2">
<s:fill>
<s:LinearGradient rotation="270">
<s:GradientEntry color="0x000000" ratio="0.0" alpha="0.0627" />
<s:GradientEntry color="0x000000" ratio="0.48" alpha="0.0099" />
<s:GradientEntry color="0x000000" ratio="0.48001" alpha="0" />
</s:LinearGradient>
</s:fill>
</s:Rect>
<!– layer 4: fill highlight –>
<!— @private –>
<s:Rect id="highlight" left="1" right="1" top="1" bottom="1" radiusX="2">
<s:fill>
<s:LinearGradient rotation="90">
<s:GradientEntry color="0xFFFFFF"
ratio="0.0"
alpha="0.33"
alpha.over="0.22"
alpha.down="0.12"/>
<s:GradientEntry color="0xFFFFFF"
ratio="0.48"
alpha="0.33"
alpha.over="0.22"
alpha.down="0.12" />
<s:GradientEntry color="0xFFFFFF"
ratio="0.48001"
alpha="0" />
</s:LinearGradient>
</s:fill>
</s:Rect>
<!– layer 5: highlight stroke (all states except down) –>
<!— @private –>
<s:Rect id="highlightStroke" left="1" right="1" top="1" bottom="1" excludeFrom="down" radiusX="2">
<s:stroke>
<s:LinearGradientStroke rotation="90" weight="1">
<s:GradientEntry color="0xFFFFFF" alpha.over="0.22" />
<s:GradientEntry color="0xD8D8D8" alpha.over="0.22" />
</s:LinearGradientStroke>
</s:stroke>
</s:Rect>
<!– layer 6: highlight stroke (down state only) –>
<!— @private –>
<s:Rect id="hldownstroke1" left="1" right="1" top="1" bottom="1" radiusX="2" includeIn="down">
<s:stroke>
<s:LinearGradientStroke rotation="90" weight="1">
<s:GradientEntry color="0x000000" alpha="0.25" ratio="0.0" />
<s:GradientEntry color="0x000000" alpha="0.25" ratio="0.001" />
<s:GradientEntry color="0x000000" alpha="0.07" ratio="0.0011" />
<s:GradientEntry color="0x000000" alpha="0.07" ratio="0.965" />
<s:GradientEntry color="0x000000" alpha="0.00" ratio="0.9651" />
</s:LinearGradientStroke>
</s:stroke>
</s:Rect>
<!— @private –>
<s:Rect id="hldownstroke2" left="2" right="2" top="2" bottom="2" radiusX="2" includeIn="down">
<s:stroke>
<s:LinearGradientStroke rotation="90" weight="1">
<s:GradientEntry color="0x000000" alpha="0.09" ratio="0.0" />
<s:GradientEntry color="0x000000" alpha="0.00" ratio="0.0001" />
</s:LinearGradientStroke>
</s:stroke>
</s:Rect>
<!– layer 7: border – put on top of the fill so it doesn't disappear when scale is less than 1 –>
<!— @private –>
<s:Rect id="border" left="0" right="0" top="0" bottom="0" width="20" height="20" radiusX="2">
<s:stroke>
<s:LinearGradientStroke rotation="90" weight="1">
<s:GradientEntry color="0x000000"
alpha="0.5625"
alpha.down="0.6375" />
<s:GradientEntry color="0x000000"
alpha="0.75"
alpha.down="0.85" />
</s:LinearGradientStroke>
</s:stroke>
</s:Rect>
</s:SparkSkin>

SECURITY WARNING: Please treat the URL above as you would your password and do not share it with anyone.

Facebook API developers be aware, due to change in FB,

redirect_uri instead of “https://www.facebook.com/connect/login_success.html”;
use this “https://m.facebook.com/connect/login_success.html”;

it will solve the issue

SECURITY WARNING: Please treat the URL above as you would your password and do not share it with anyone.

Fix for Windows 8 Metro Apps Internet Issue

Fix for Windows 8 Metro Apps Internet Issue

Install Fiddler 4, click on Windows 8 Config, Exempt all, Save changes, keep the fiddler running always for connecting to internet

Execute Metro Apps from Desktop

Step 1:

Install  VS Premium

Step 2:

Execute Simulator

“C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Simulator\11.0\Microsoft.Windows.Simulator.exe”

How do you turn WiFi on in the Windows 8

Suddenly Windows 8, WiFi off was the status and wasn’t able to use Wifi Networks!!

http://img694.imageshack.us/img694/2959/62721723.png

Tried many fixes but nothing worked out.. the below is what helped me solve the issue..

Find “Window Power Shell” using Windows + F key.. run.. the command below

get-Wmiobject -class win32_networkadapter -namespace root\CIMV2 | where-object {$_.Name -match “Wifi” -or $_.Name -match “wireless” -and $_.name -notmatch “Microsoft Virtual WiFi Miniport Adapter” -and $_.netenabled -eq  $false} | % {$_.enable() }

Now right click wifi network and diagnoze and fix to make wifi on

The serial key generator for Flex / AIR product to licence the RIA Product

http://code.google.com/p/codegenas3/

The project uses MD5 Encryption to generate the serial key, specific to Machine. The Unique key on system basis is generated and respective serial key is verified with the MD5 Checksum. Can be used on Flex / AIR products selling.

Also, uses SharedObject to store the unique System Key

Usage:
import adams.dev.MD5;
var reg:MD5 = new MD5();
reg.registereduser – > status of user registration
reg.skey – > serial key of the end user
reg.setRegKey(reg.skey); – > to enable the product

Note: The project is 3 years older work done by me.

Circle Radiant AS3 Button

Code Available here https://gist.github.com/3180501

Average RGB colors

Util for Finding Average RGB colors seperately

https://gist.github.com/2490634

Detect Skin Colors using AS3

Did a stint on Flex after a long gap, got this..

https://gist.github.com/2421025

https://gist.github.com/2421017

Spark Color Picker

Spark based Color Picker Component : Check the code base
https://gist.github.com/1527354 – Usage

https://gist.github.com/1527366
https://gist.github.com/1527361
https://gist.github.com/1527358

https://gist.github.com/1559232

set maintainAspectRatio true for Spark Image

To use maintainAspectRatio true in your Spark Image, use the fillMode=”scale” and scaleMode=”letterbox”

<s:Image id=”img” smooth=”true” fillMode=”scale” scaleMode=”letterbox” />

due to : spark.primitives.BitmapImage

private function get maintainAspectRatio():Boolean{
return (_scaleMode == BitmapScaleMode.LETTERBOX && _fillMode == BitmapFillMode.SCALE);}

SVG Editor

Code Snippet for SVG Editor tool using AS3 https://gist.github.com/1506440

Color Transform Image in AS3

Code Snippet to Color Transform the Image https://gist.github.com/1505064

Away3d With AIR

To Solve the problem : Error #2044: Unhandled ErrorEvent:. text=Error #3702: Context3D not available.
Keep the AIR xml rendermode property into gpu
gpu

iOS Packaging from Flex

My latest experience on converting Flex App to iOS, might be of use for beginners.

Debug version ipa generation is faster than rest, make sure you select Ad Hoc Distribution for testing the app on any device with Developer licence and Developer Provisioning Profile.

Make sure you use Mac for porting the application with Apple’s iPhone Configuration Utility, otherwise with windows use iTunes for porting the app into Device.

Reason:

You cannot install IPA files to the device via Apple’s iPhone Configuration Utility on WIN, got error “Could not install application on device. Error kAMDReceiveMessageError”. Workaround is to install IPA with iTunes on Windows or iTunes/iPhone Configuration Utility on Mac OS (2810687) (source : http://kb2.adobe.com/cps/891/cpsid_89107.html)

The list of Device Capabilities to work with Camera

<key>UIRequiredDeviceCapabilities</key>
<array>
   <string>front-facing-camera</string>
   <string>auto-focus-camera</string>
   <string>camera-flash</string>
   <string>video-camera</string>
 </array>

Dispatching Mouse Event on Any X,Y Coordinate

 

 

 

 

The Code Snippet for Dispatching Mouse Event Manually https://gist.github.com/1334083

Applying Mask to overlay colors on any shape

Inspired by iTailor.com, the site which helps to design shirts online.
Made a mask with shirt shape to overlay on the shirt, for dynamically changing color of the shirt.

Code:
https://github.com/nsdevaraj/Tailor

Face Detection in AS3

Lately working in FaceDetection, did shared code of my first steps on Face Detection
https://github.com/nsdevaraj/FaceDetect

Hope it helps for beginners

Flex 4 ACE Mock Exam

Glad to release the version 1.0 of FlexACE Mock Exam Application:

The Application is based on our experience of getting ACE Certification.
The application free for download on these links:

Source Link, Android App Link, BlackBerry App Link, Amazon App Link, Desktop AIR Link

Looking forward to your feedback to improve the application Experience.
Best wishes on getting ACE Certification.

Flex Mobile Apps

Demo Videos List

Apps Github Source Android Market BlackBerry AppWorld Amazon AppStore
eStud Link Link Link Link
UniversalCurrency Link Link Link Link
FlexMock Link Link Link Link
EduTube Link Link Link Link
CartoonTV Link Link Link Link
RhymeTV Link Link Link Link
AnimatorWatch Link Link Link Link

ByteArray Util

ByteArray to Encode and Decode Objects as String
https://gist.github.com/1051042 based on http://goo.gl/8WdQu

Util for Picking Random XML Entry

Code for picking up random XML entries from XMLList : code

Swiz Framework for Mobile Development (Source Example)

Source for Android/ iOS/ Blackberry Mobile App Universal-Currency.
Developed with Flex 4.5.1 SDK and AIR 2.7 SDK

The project does currency conversion, using HTTPService via SwizDAO Framework

Check the code base:
https://github.com/nsdevaraj/Universal-Currency

Cairngorm revisited, with Flex 4.5

Did used Cairngorm after long time with Flex 4.5 SDK, it’s fun working with Cairngorm after more than 2 years.
Did a sample code base for RSS viewer.
Check the code:
https://github.com/nsdevaraj/RSSViewer

Move Scroll bar on left side Flex4

I struggled a lot, but fixed it with easy tweak.
s:List Property -> layoutDirection=”rtl”
Note, in case you were using itemRenderer , make the reverse there to avoid arabic right to left effect by :
s:ItemRenderer Property -> layoutDirection=”ltr”

Random Password Generation

A Small Util Function to create random Password Generation https://gist.github.com/988479

Parallel Computing in AS3 //P

Managed to create a Master – Slave architecture between a group of SWF Files.
This group will have a Master SWF which will command other slave swf’s to do certain processing.

This architecture might be helpful in distributing the processing to many files thus reducing the Memory being occupied in a Single SWF.

With IoC in proper form in future, will be successful editing the Slave SWF’s Dynamically.

Code for Master : https://gist.github.com/9bd094ac172d336004c6

Code for Slaves : https://gist.github.com/a840cea1258e019176d8

This Architecture avails running multiple threads with different SWF files at same time

Firefox hanging on Debug

launch firefox -> about:config
Modify the value of  dom.ipc.plugins.timeoutSecs to -1

This helps hanging of firefox after default 45 seconds while debugging with break points in Flex

AS3 Design Patterns

Did prepared Presentation of AS3 Design Patterns : http://goo.gl/gk4eP

Find the User Country from Flex

First of All, we need JSP / ASP for getting the IP Address, Example code: Link
After getting the IP, using the below IP Web Service we can find the End- User’s Country.
http://www.webservicex.net/geoipservice.asmx?op=GetGeoIP

DAO / Pojo Generator for Java

Was unable to download the “DAO4J” best Open Source DAO generator of Java (Plugin for Squirrel Client).
At last found it from my Backups, will be useful tool for those looking for Pojo or DAO generation from any DB.

Get the Plugin from the link : dao4j.zip

XML to Object

The Project i have created converts the XML into required object in simple steps. Have a look on it : XSLT

XML to Object

XML to Object function can be found here :Gist

This will be useful for converting XML to ArrayCollection

Andriod AIR Emulator Runtime

Was searching for emulator_runtime.apk all over the web for download, at last found it on my sdk runtime path.
C:\… \sdks\4.5.0\runtimes\air\android\emulator

Try Yours 🙂

Convert int to String

The AS3 Util Function is posted on the below link
Utility to convert number or integer to String. The util function is useful in many applications.
https://gist.github.com/703108

AIR install problem with MAC PowerPC / Leopard

Windows 2000 and Mac PowerPC are not supported with AIR 2. Users can install and run AIR 1.5 applications, but will not be able to install or update to AIR 2.
Source – http://www.adobe.com/products/air/systemreqs/

The below are the links to be used for MAC – AIR 1.5 installer

http://airdownload.adobe.com/air/mac/download/1.5/AdobeAIR.dmg
http://airdownload.adobe.com/air/mac/download/1.5.3/AdobeAIR.dmg

Flex 4 in a Week

Watch Flex4 videos from Adobe or refer torrent to download them

Flex 4 Best Explained on Pictures :

Flex 4 DOM Tree model – [Link]

New Flex 4, Spark Classes to be known

Flex4 Framework
spark.effects.AddAction
spark.effects.Animate
spark.effects.AnimateColor
spark.effects.AnimateFilter
spark.effects.AnimateTransitionShader
spark.effects.AnimateTransform
spark.effects.AnimateTransform3D
spark.effects.animation.Animation

mx.collections.ArrayList
spark.filters.BevelFilter
spark.primitives.BitmapImage
spark.layouts.supportclasses.Block
spark.filters.BlurFilter
spark.components.BorderContainer
spark.effects.easing.Bounce

spark.components.supportclasses.ButtonBarHorizontalLayout
spark.components.supportclasses.ButtonBase
spark.effects.CallAction
spark.components.CheckBox
spark.filters.ColorMatrixFilter
flash.geom.ColorTransform
spark.layouts.ColumnAlign
spark.components.ComboBox
spark.filters.ConvolutionFilter
spark.effects.CrossFade

spark.components.DataRenderer
spark.filters.DisplacementMapFilter

spark.layouts.supportclasses.DropLocation
spark.filters.DropShadowFilter
spark.components.mediaclasses.DynamicStreamingVideoSource
spark.components.mediaclasses.DynamicStreamingVideoItem
spark.effects.easing.Elastic
spark.primitives.Ellipse
spark.effects.Fade
spark.primitives.supportclasses.FilledElement
spark.filters.GlowFilter
spark.filters.GradientBevelFilter
spark.filters.GradientFilter
spark.filters.GradientGlowFilter
spark.primitives.Graphic
spark.primitives.supportclasses.GraphicElement

spark.components.supportclasses.GroupBase

spark.effects.interpolation.HSBInterpolator
spark.components.HScrollBar

spark.components.supportclasses.ItemRenderer
spark.effects.animation.Keyframe

spark.layouts.supportclasses.LayoutBase
spark.primitives.Line
spark.effects.easing.Linear

spark.components.supportclasses.ListBase
spark.core.MaskType
flash.geom.Matrix
flash.geom.Matrix3D
spark.effects.animation.MotionPath
spark.effects.Move
spark.effects.Move3D
spark.effects.interpolation.MultiValueInterpolator
spark.components.mediaclasses.MuteButton
spark.components.NavigatorContent
spark.effects.interpolation.NumberInterpolator

spark.primitives.Path
spark.components.PopUpAnchor
spark.components.PopUpPosition
spark.effects.easing.Power

spark.components.supportclasses.Range
spark.primitives.Rect
spark.primitives.RectangularDropShadow
mx.collections.AsyncListView
spark.effects.RemoveAction
spark.effects.Resize
spark.effects.interpolation.RGBInterpolator
spark.components.RichEditableText
spark.components.RichText
spark.effects.Rotate
spark.effects.Rotate3D
spark.layouts.RowAlign
spark.effects.Scale
spark.effects.Scale3D
spark.components.supportclasses.ScrollBarBase
spark.components.Scroller
spark.components.supportclasses.ScrollerLayout
spark.components.mediaclasses.ScrubBar
spark.effects.SetAction
spark.filters.ShaderFilter
spark.effects.animation.SimpleMotionPath
spark.effects.easing.Sine
spark.components.supportclasses.Skin
spark.components.supportclasses.SkinnableComponent
spark.components.SkinnableContainer
spark.components.supportclasses.SkinnableContainerBase
spark.components.SkinnableDataContainer
spark.components.supportclasses.SkinnableTextBase
spark.components.supportclasses.SliderBase
spark.skins.SparkSkin
spark.components.Spinner
spark.core.SpriteVisualElement
spark.primitives.supportclasses.StrokedElement
spark.components.TabBar

spark.components.supportclasses.TextBase

spark.components.TextSelectionHighlighting
spark.utils.TextUtil
spark.components.TileGroup
spark.layouts.TileLayout
spark.layouts.TileOrientation
spark.effects.animation.Timeline
spark.components.TitleWindow
spark.components.ToggleButton
spark.components.supportclasses.ToggleButtonBase
spark.components.supportclasses.TrackBase
mx.geom.Transform
mx.geom.TransformOffsets
spark.components.VideoDisplay
spark.components.VideoPlayer
spark.components.mediaclasses.VolumeBar
spark.effects.Wipe
mx.collections.XMLListCollection

Special Components
mx.states.AddItems

airframework
spark.components.windowclasses.TitleBar

FTE text for MX components
mx.controls.dataGridclasses.FTEDataGridItemRenderer
mx.controls.MXFTETextInput
mx.controls.advancedDataGridclasses.FTEAdvancedDataGridItemRenderer

Text Layout Framework (TLF)
flashx.textLayout.elements.LinkElement
flashx.textLayout.elements.BreakElement
flashx.textLayout.elements.DivElement
flashx.textLayout.elements.InlineGraphicElement
flashx.textLayout.elements.ParagraphElement
flashx.textLayout.elements.SpanElement
flashx.textLayout.elements.TabElement
flashx.textLayout.elements.TCYElement
flashx.textLayout.elements.TextFlow
flashx.textLayout.formats.TextLayoutFormat


mx.rpc.CallResponder
mx.messaging.channels.HTTPChannel
mx.rpc.remoting.mxml.Operation
mx.messaging.channels.SecureHTTPChannel
mx.messaging.channels.SecureStreamingHTTPChannel
mx.messaging.channels.SecureRTMPChannel
mx.messaging.channels.StreamingHTTPChannel

Flex 3 Graphics
mx.geom.CompoundTransform
mx.graphics.GradientEntry
mx.graphics.LinearGradient
mx.graphics.LinearGradientStroke
mx.graphics.RadialGradient
mx.graphics.RadialGradientStroke
mx.graphics.SolidColor
mx.graphics.SolidColorStroke
mx.graphics.Stroke
mx.geom.Transform

Flex 3 Miscellaneous
mx.logging.targets.MiniDebugTarget
mx.logging.targets.TraceTarget

MXItemRenderer
mx.controls.listclasses.MXItemRenderer
mx.controls.treeclasses.MXTreeItemRenderer
mx.controls.dataGridclasses.MXDataGridItemRenderer
mx.controls.advancedDataGridclasses.MXAdvancedDataGridItemRenderer

Things i learnt new from ACE -Flex4

ACE exam was a good learning experience for me, I came to learn about these new things yesterday.

  • saveCache is used in LCDS for offline mode saving.
  • Native Platform style is default setting for AIR.
  • FileMode.Update is used to make the both file writing and reading.
  • AcceptDragDrop is the method used to accept an DragObject and DoDrag is to initiate the dragging.
  • SQLConnection is the class used for setting SQLLite into write mode.
  • SQLStatement class property “text” is used for the sql querying purpose.
  • mouseDownEffect also can be used to set the Effect on MouseClick.
  • widthInChars is new property for TextInput which can be used to set width.
  • AIR can access the methods of loaded SWF by default.

Flex 4 ACE Questions

Passed ACE Certification with Flex4.

The differences of Flex3 and Flex 4 certifications
1/ more questions – 59 questions (previously 50)
2/ more time – 90 minutes (previously 60 min) Don’t bother about time factor you will have at least 30 minutes spare time for review.
3/ UI have more share among questions 35 %
4/ In Flex_Exam_Guide – They didn’t mentioned about LCDS, but we got Questions from LCDS too.

Tips:
1/ Do use attest, as it is the only resource we have for mockup
2/ Unlike Attest the questions will be in shuffled order
3/ While you attend ACE, don’t forget to use “Flag for review”, whenever you have doubt on your answer.
4/ The Questionnaire will be different for everyone

The below are some important topics, these areas required to be refreshed before attempting ACE.

LCDS
RemoteObject vs. Webservice vs. HTTPService

Flex3
[RemoteClass],[Bindable] Metadatas,E4X xml query, Labelfunction and Labelfield usage,Custom Event, Producer, consumer, validator,TabNavigator ,viewstack, setStyle, BlendMode, Modules vs. Sub Applications and formatter

OOPS
Interface, Encapsulation, Design patterns, access modifiers, Constructor and getter setters

AIR:
native platform in AIR Application,File management in AIR, Preloader, Drag and Drop in AIR, Security Sandbox in AIR, SQL Lite in AIR, create a Native AIR Application, Badge Installer in AIR

Spark :
working with state, ArrayList vs. Arraycollection, Animate, constraint layout in Spark Components, orientation of Child components,effects, create a custom component, Two-Way Binding, IVisualElement, ItemRenderer, LayoutBase, SkinnableComponent, TextInput, CSS namespace declaration, Descendant ID Type Class CSS types and Group

Dynamic Injection on runtime using BeanFactory

Met with requirement to inject object dynamically at runtime based on Push Message received.

Had a bit hard time finding solution, unusual with Swiz Framework.
Thought of sharing my experience here..
Step 1: In swiz Context assign the bean factory to your Bean Class

messenger.beanFactory = this.beanFactory;

Step 2:
In your bean class, Implement Interface IBeanFactoryAware
public class NativeMessenger implements IBeanFactoryAware

Step 3:
To Satisfy the implementation add the below code:
private var _beanFactory:IBeanFactory;
public function set beanFactory( beanFactory:IBeanFactory ):void{
_beanFactory = beanFactory;
}
Step 4:
Got access to Beanfactory
public var dynamicDAO:AbstractDAO;
protected function consumeHandler(event:MessageEvent =null) : void
{
var daoName:String = event.message.headers[“dynamicdao”];
dynamicDAO = _beanFactory.getBeanByName(daoName).source as AbstractDAO;
}

Now the dynamicDAO is assigned with the bean dynamically based on the consumer Message.

Flash Builder Network Monitor Bug

When a sequence of service calls made to server using, Blaze DS.

I got the below error, where as i used to get the result handler and fault handler responses for the same request.
There was nothing wrong in server side,
[FaultEvent fault=[RPC Fault faultString=”Error #2006: The supplied index is out of bounds.” faultCode=”InvokeFailed” faultDetail=”null”] messageId=”” type=”fault” bubbles=false cancelable=true eventPhase=2]

At last, i got it by disabling the Network Monitor of Flash builder things were back in shape..

Flex4 Module Loading

Tried out module loading in Flex 4 with Swiz, posted the code in Github link.
Hope, this is useful while using modules with Flex4.
Usage:
On change of moduleIndex the new module will be loaded on stage, the example is an alternative for viewStack elements loading.

Record FLV with Screensharing

With AIR 2 Native Process help,  Print.jar helps press PrintScreen and the data from clipboard is used to get Screen Shots  to be written in FLV using FlvWriter.as
The Main Application file used to write FLV using the screen shot images is in this link.

Merge / Combine two ArrayCollections

// ArrayCollection 1
var arrC1:ArrayCollection;
// ArrayCollection 2
var arrC2:ArrayCollection; 
var array1:Array = arrC1.source
var array2:Array = arrC2.source
public function arrayContainsValue(arr:Array, value:Object):Boolean
{
       return (arr.indexOf(value) != -1);
}  
public function createUniqueCopy(a:Array):Array{
       var newArray:Array = new Array();        
       var len:Number = a.length;
       var item:Object;        
       for (var i:uint = 0; i < len; ++i)
       {
               item = a[i];                
               if(arrayContainsValue(newArray, item))
               {
                       continue;
               }
               newArray.push(item);
       }
       return newArray;
}  
var combinedArr:Array = createUniqueCopy(array1.concat(array2) );
var resultArrC:ArrayCollection =new ArrayCollection( combinedArr );

Camstudio video annotation

“unable to detect webcam / video source”

The above is the message i got continuously after trying a lot, so fixed it with Flex by creating a AIR to show the Webcam Video.
Source:

<?xml version="1.0" encoding="utf-8"?> <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" maxHeight="150" maxWidth="200" showStatusBar="false" skinClass="assets.DTApplicationSkin" alwaysInFront="true"> <fx:Script> <![CDATA[ private function videoDisplay_creationComplete():void { var camera:Camera = Camera.getCamera(); if (camera) { videoDisplay.attachCamera(camera); } } ]]> </fx:Script> <mx:VideoDisplay id="videoDisplay" creationComplete="videoDisplay_creationComplete();" width="100%" height="100%" horizontalCenter="0" verticalCenter="0"/> </s:WindowedApplication>


The link have the AIR file required. Download

How to Modify SWF without Recompilation

I could n’t access my Laptop last week, but i had some urgent work to do (recompile a old SWF). Here is how i did it.
This post is just a reference and guide based on the Post.
Find the Point which you want to modify using any of the available SWF Decompilers
Decompress the SWF using java.util.zip.DeflaterInputStream : Java Source Code file link
Jar File Download Link
Usage :  java -jar SWFCompress.jar c 'YourSWF.swf'
Download the Nemo440.AIR , to view the hex code.
Notice the exact place of the code to be modified using
The conventions of u30 encrypted Hex code is provided by Adobe.
Download any Free Hex Editors like HxD, to edit the SWF
Find the code part and modify the -decompressed SWF
Compress the decompressed SWF, back to the form, using SWFCompress.jar.
Usage :  java -jar SWFCompress.jar d 'YourSWF.swf'

Now the re compressed SWF is ready to go. Have Fun Cracking, Hacking SWF’s

Project: Swiz DAO

Libraries Used:  Swiz, AS3Signals and FoomongerSwizFramework.
Objective:
To create GenericDAO framework, like IBM Generic DAO (Java /Spring/ Hibernate)
About GenericDAO:
DAO is the Object which manages to perform CRUD Operation and other Common
Operations to be done over a ValueObject ( known as Pojo in Java ).
GenericDAO is a reusable DAO class which can be used generically.
Goal:

In IBM GenericDAO, to add a new DAO, the steps to be done is simply,
  1. Add a valueobject (pojo).
  2. Add a hbm.xml mapping file for the valueobject.
  3. Add the 10-line Spring configuration file for the DAO.
Similarly, in AS3 Project Swiz DAO. We want to attain a similar feet of achievement.
Client Side GenericDAO model:
As we were working on a Client Side language, also we should be managing a persistent object Collection (for every valueObject) .
Usage:
<swiz:Prototype name=”personDAO”
constructorArguments=”{[‘person’,personProcessor]}” type=”{AbstractDAO}”
singleton=”true”/>
Added, How it works in Github: DI Mechanism Link

http://github.com/nsdevaraj/SwizDAO

Generic DAO in AS3

Built an AS3 Project to Work with GenericDAO using Swiz and AS3Signals

The project was inspired by Java Spring Framework:
IBM Generic Dao

The project uses the benefits of DI provided by Swiz 1.0.
The Deferred Instantiation of Swiz builds DAO Object only when [Inject] keyword is used.

Also, uses the latest Spark SkinnableComponent Framework for the View Part with Passive View.

The Source can be downloaded from SwizDAO Git
The below is the code from Swiz Context for a DAO Object:

<swiz:Prototype name=”taskDAO” constructorArguments=”{[‘task’,taskProcessor]}” type=”{AbstractDAO}” singleton=”true”/>

Update Info : https://nsdevaraj.wordpress.com/2010/05/12/project-swiz-dao/